// 代码示例:
#include <shadow.h>
#include <stdio.h>
#include <stdlib.h>

int main() {
    const char *username = "zs";
    struct spwd *pwd = getspnam(username);
    if (pwd == NULL) {
        printf("查询出错或者账号不存在 \n");
        return 0;
    }

    printf("UserName: %s\n", pwd->sp_namp);
    printf("Password: %s\n", pwd->sp_pwdp);

    return 0;
}
